/*
 * DBManager.h
 *
 *  Created on: Aug 25, 2016
 *      Author: ubuntu
 */

#ifndef DBMANAGER_H_
#define DBMANAGER_H_

#include <iostream>
#include <queue>
#include <pthread.h>
#include "DataInfo.h"


using namespace std;

class DBManager {
public:
	DBManager(const char *path);
	virtual ~DBManager();
	static void *DBThread(void *arg);

	virtual void push(DataInfo *);

	virtual void run();

	virtual void stop();


private:
	queue<DataInfo *> m_lstDataInfo;
	pthread_mutex_t data_mutex;
	char *m_path;
	bool m_bTerminated;
	int m_thread;
//	unsigned int m_count;
};

#endif /* DBMANAGER_H_ */
